import{
    createRouter,
    createWebHashHistory
} from 'vue-router'

import login from "~/components/user/login.vue"
import mianView from "~/components/userView/mianView.vue";
import register from "~/components/user/register.vue";
import NotFound from '~/components/404.vue'
import history from '~/components/userView/history.vue'
import configureCrawler from '~/components/userView/configureCrawler.vue'
import errorMessage  from '~/components/userView/errorMessage.vue'
import indexPDF from '~/components/userView/indexPDF.vue'
import dataDisposal from '~/components/userView/dataDisposal.vue'
import test from '~/components/test.vue'
import dataVisualization  from '~/components/userView/dataVisualization.vue'
const routes=[
    {
        path:"/",
        redirect: '/login'
    },
    {
        path: "/login",
        component: login
    },
    {
        path: "/test",
        component: test
    },
    {
        path: "/index",
        component: mianView,
        children:[
            {
                path: '/history',
                name:'history',
                component: history
            },
            {
                path: '/configureCrawler',
                name: 'configureCrawler',
                component: configureCrawler
            },
            {
                path: '/errorMessage',
                name: 'errorMessage',
                component: errorMessage
            },
            {
                path: "/indexPDF",
                name: 'indexPDF',
                component: indexPDF
            },
            {
                path: "/dataDisposal",
                name: "dataDisposal",
                component: dataDisposal
            },
            {
                path: "/dataVisualization",
                name: "dataVisualization",
                component: dataVisualization
            }
        ]

    },
    {
        path: "/register",
        component: register
    },
    {
        path: "/:pathMatch(.*)*",
        name:"notFound",
        component: NotFound
    }

]
const router= createRouter({
    history:createWebHashHistory(),
    routes:routes
})
export default router